<template>
  <div class="container">
    <div class="head">
      <span>酒店信息管理</span>
    </div>
    <div class="hotel-info">

      <el-input placeholder="请输入内容" v-model="hotelInfo.hotelName">
        <template slot="prepend">酒店名字</template>
      </el-input>
      <el-input placeholder="请输入内容" v-model="hotelInfo.hotelAddress">
        <template slot="prepend">酒店地址</template>
      </el-input>
      <el-input placeholder="请输入内容" v-model="hotelInfo.hotelPhone">
        <template slot="prepend">酒店电话</template>
      </el-input>
      <el-input placeholder="请输入内容" v-model="hotelInfo.hotelLevel">
        <template slot="prepend">酒店等级</template>
      </el-input>
      <el-input placeholder="请输入内容" :title="hotelInfo.hotelIntroduction" v-model="hotelInfo.hotelIntroduction">
        <template slot="prepend">酒店周边</template>
      </el-input>
      <el-input placeholder="请输入内容" :title="hotelInfo.hotelNotice" v-model="hotelInfo.hotelNotice">
        <template slot="prepend">入住须知</template>
      </el-input>
      <el-input placeholder="请输入内容" v-model="hotelInfo.hotelPolicyCheckin">
        <template slot="prepend">入住时间</template>
      </el-input>
      <el-input placeholder="请输入内容" v-model="hotelInfo.hotelPolicyCheckout">
        <template slot="prepend">退房时间</template>
      </el-input>
    </div>
    <el-button plain type="danger" @click="updateHotel">修改</el-button>
  </div>
</template>

<script>
import {AdminHotelInfo, AdminUpdateHotelInfo, HotelInfo} from "@/api";

export default {
  name: "Hotel",
  data(){
    return{
      hotelInfo: {}
    }
  },
  methods:{
    updateHotel(){
      AdminUpdateHotelInfo(this.hotelInfo).then(res => {
        this.$notify({
          title: res.message,
          type: "success"
        })
      })
    }
  },
  created() {
    AdminHotelInfo().then(res => {
      this.hotelInfo = res.data
      console.log(this.hotelInfo)
    })
  }
}
</script>


<style scoped lang="less">
.container{
  background: #e8e6e6;
  border-radius: 8px;
  margin: 16px 128px;
  padding: 16px;
  min-width: 560px;
  .head{
    span{
      font-weight: 600;
      color: darkgrey;
    }
    display: flex;
    justify-content: space-between;
    margin-right: 80px;
    margin-bottom: 24px;
    align-items: center;
  }
  .hotel-info{
    width: 50%;
    min-width: 480px;
    margin: auto;
    /deep/.el-input{
      margin: 8px 0;
    }
  }
}
</style>